package com.study.ssm.annotation02.config2;

import com.study.ssm.annotation02.bean.User;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Service;

@Configuration
/**
 * 排除策略
 * <context:component-scan base-package="com.study.ssm.annotation">
 *         <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Component"/>
 *         <context:exclude-filter type="assignable" expression="com.study.ssm.annotation.life.Product"/>
 * </context:component-scan>
 */
/*@ComponentScan(basePackages = "com.study.ssm.annotation02.scan",
               excludeFilters = {@ComponentScan.Filter(type= FilterType.ANNOTATION,value={Service.class}),
                                 @ComponentScan.Filter(type= FilterType.ASPECTJ,pattern = "*..User1")})*/
/**
 * 包含策略
 * <context:component-scan base-package="com.study.ssm.annotation" use-default-filters="false">
 *         <context:include-filter type="annotation" expression="org.springframework.stereotype.Component"/>
 *         <context:include-filter type="aspectj" expression="com.study.ssm.annotation.injection..*"/>
 *         <context:include-filter type="assignable" expression="com.study.ssm.annotation.life.Product"/>
 *  </context:component-scan>
 */
/*@ComponentScan(basePackages = "com.study.ssm.annotation02.scan",
               useDefaultFilters = false,
               includeFilters = {@ComponentScan.Filter(type= FilterType.ANNOTATION, value={Service.class})})*/

@ComponentScan(basePackages = "com.study.ssm.annotation02.scan")
// @Import 不受包含  排除策略控制
@Import(User.class)
public class AppConfig2 {

}
